<template>

  <div class="richText" v-html="contentData"></div>

</template>

<script>
  import graceRichText from '@/common/richText.js';
  export default {
    name: 'c-rich-text',
    props: {
      content: {
        type: [Number,String],
        default: ''
      }
    },
    computed: {
      contentData: function () {
        let content = this.content
        if(typeof content !== 'string'){
          content=content.toString()
        }
        return graceRichText.format(content);
      }
    },
    methods: {
      isNumber(value) {
        return !isNaN(parseFloat(value)) && isFinite(value);
      }
    }
  }
</script>
